package ru.susu.algebra.partition.comparators;

import java.util.Comparator;

import ru.susu.algebra.chartable.degree.HooksDegreeCalculator;
import ru.susu.algebra.chartable.degree.IDegreeCalculator;
import ru.susu.algebra.partition.Partition;

/**
 * @author akargapolov
 * @since: 12.03.2009
 */
public class SymmByCharDegreeComparator implements Comparator<Partition>
{

	@Override
	public int compare(Partition p1, Partition p2)
	{
		IDegreeCalculator calculator = new HooksDegreeCalculator();
		return calculator.calculateDegree(p1).compareTo(calculator.calculateDegree(p2));
	}

}
